<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>系统设置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__STATICS__/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="__STATICS__/css/public.css" media="all">
    <style>
        .layui-form-item .layui-input-company {width: auto;padding-right: 10px;line-height: 38px;}
    </style>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <form class="layui-form">
        <div class="layui-tab">
          <ul class="layui-tab-title">
            <li class="layui-this">网站设置</li>
            <li>其他设置</li>
          </ul>
          
          <div class="layui-tab-content">

            <!-- 网站设置 -->
            <div class="layui-tab-item layui-show">
                <div class="layui-form layuimini-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">网站名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="site[sitename]" lay-verify="required" lay-reqtext="网站域名不能为空" placeholder="请输入网站名称"  value="{$setting.site.sitename.value}" class="layui-input">
                            <tip>填写自己部署网站的名称。</tip>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">META关键词</label>
                        <div class="layui-input-block">
                            <textarea name="site[keywords]" class="layui-textarea" placeholder="多个关键词用英文状态 , 号分割">{$setting.site.keywords.value}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">META描述</label>
                        <div class="layui-input-block">
                            <textarea name="site[descript]" class="layui-textarea">{$setting.site.descript.value}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label required">版权信息</label>
                        <div class="layui-input-block">
                            <textarea name="site[copyright]" class="layui-textarea">{$setting.site.copyright.value}</textarea>
                        </div>
                    </div>

                </div>
            </div>
            <!-- 网站设置 -->
            <!-- 其他设置 -->
            <div class="layui-tab-item">
                <div class="layui-form-item">
                    <label class="layui-form-label required">测试</label>
                    <div class="layui-input-block">
                        <input type="text" name="other[ceshi]" lay-verify="required" lay-reqtext="" placeholder=""  value="{$setting.other.ceshi.value}" class="layui-input">
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="setting">确认保存</button>
                </div>
            </div>

          </div>
          
        </div>
        </form>
        
    </div>
</div>
<script src="__STATICS__/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>

    layui.use(['form','element'], function () {
        var $   =  layui.jquery,
            form = layui.form,
            element = layui.element, 
            layer = layui.layer;

        //监听提交
        form.on('submit(setting)', function (data) {
            loading =layer.load(1, {shade: [0.1,'#fff']});
            $.post("", data.field, function (res) {
                layer.close(loading);
                if (res.code > 0) {
                    layer.msg(res.msg, {time: 1800, icon: 1}, function () {
                       location.href = res.url;
                    });
                } else {
                    layer.msg(res.msg, {time: 1800, icon: 2});
                }
            });
            return false;
        });

    });
</script>
</body>
</html>